Public Class frmOrderType
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents btnCancel As System.Windows.Forms.Button
    Friend WithEvents btnOK As System.Windows.Forms.Button
    Friend WithEvents pnlProperties As System.Windows.Forms.Panel
    Friend WithEvents txtOrderName As System.Windows.Forms.TextBox
    Friend WithEvents lblOrderName As System.Windows.Forms.Label
    Friend WithEvents txtDescription As System.Windows.Forms.TextBox
    Friend WithEvents lblDescription As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmOrderType))
        Me.btnCancel = New System.Windows.Forms.Button()
        Me.btnOK = New System.Windows.Forms.Button()
        Me.pnlProperties = New System.Windows.Forms.Panel()
        Me.txtDescription = New System.Windows.Forms.TextBox()
        Me.lblDescription = New System.Windows.Forms.Label()
        Me.txtOrderName = New System.Windows.Forms.TextBox()
        Me.lblOrderName = New System.Windows.Forms.Label()
        Me.pnlProperties.SuspendLayout()
        Me.SuspendLayout()
        '
        'btnCancel
        '
        Me.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.btnCancel.Location = New System.Drawing.Point(136, 152)
        Me.btnCancel.Name = "btnCancel"
        Me.btnCancel.Size = New System.Drawing.Size(56, 23)
        Me.btnCancel.TabIndex = 2
        Me.btnCancel.Text = "Cancel"
        '
        'btnOK
        '
        Me.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.btnOK.Location = New System.Drawing.Point(72, 152)
        Me.btnOK.Name = "btnOK"
        Me.btnOK.Size = New System.Drawing.Size(56, 23)
        Me.btnOK.TabIndex = 1
        Me.btnOK.Text = "OK"
        '
        'pnlProperties
        '
        Me.pnlProperties.BackColor = System.Drawing.SystemColors.ControlLight
        Me.pnlProperties.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.pnlProperties.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtDescription, Me.lblDescription, Me.txtOrderName, Me.lblOrderName})
        Me.pnlProperties.Location = New System.Drawing.Point(8, 8)
        Me.pnlProperties.Name = "pnlProperties"
        Me.pnlProperties.Size = New System.Drawing.Size(192, 136)
        Me.pnlProperties.TabIndex = 5
        '
        'txtDescription
        '
        Me.txtDescription.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.txtDescription.Location = New System.Drawing.Point(16, 72)
        Me.txtDescription.Multiline = True
        Me.txtDescription.Name = "txtDescription"
        Me.txtDescription.Size = New System.Drawing.Size(168, 56)
        Me.txtDescription.TabIndex = 11
        Me.txtDescription.Text = "Enter a description."
        '
        'lblDescription
        '
        Me.lblDescription.Location = New System.Drawing.Point(7, 56)
        Me.lblDescription.Name = "lblDescription"
        Me.lblDescription.Size = New System.Drawing.Size(72, 16)
        Me.lblDescription.TabIndex = 12
        Me.lblDescription.Text = "Description"
        Me.lblDescription.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'txtOrderName
        '
        Me.txtOrderName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.txtOrderName.Location = New System.Drawing.Point(16, 32)
        Me.txtOrderName.Name = "txtOrderName"
        Me.txtOrderName.Size = New System.Drawing.Size(168, 20)
        Me.txtOrderName.TabIndex = 0
        Me.txtOrderName.Text = "New Order"
        '
        'lblOrderName
        '
        Me.lblOrderName.Location = New System.Drawing.Point(7, 11)
        Me.lblOrderName.Name = "lblOrderName"
        Me.lblOrderName.Size = New System.Drawing.Size(72, 16)
        Me.lblOrderName.TabIndex = 10
        Me.lblOrderName.Text = "Order Name"
        Me.lblOrderName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'frmOrderType
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(206, 182)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnCancel, Me.btnOK, Me.pnlProperties})
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.Name = "frmOrderType"
        Me.ShowInTaskbar = False
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
        Me.Text = "Order Properties"
        Me.pnlProperties.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private ptrNewItem As cmplib01.OrderType
    Private mCancelPressed As Boolean = False

    Public Sub New(ByRef newOrder As cmplib01.OrderType)
        Me.New()
        ptrNewItem = newOrder
        txtOrderName.Text = ptrNewItem.OrderName
        txtDescription.Text = ptrNewItem.Description
    End Sub

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        If Not txtOrderName.Text = "" Then ptrNewItem.OrderName = txtOrderName.Text
        ptrNewItem.Description = txtDescription.Text
        mCancelPressed = False
        Me.Hide()
    End Sub

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        mCancelPressed = True
        Me.Hide()
    End Sub

    Public ReadOnly Property CancelPressed() As Boolean
        Get
            Return mCancelPressed
        End Get
    End Property

End Class
